package com.webas.entities;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.annotations.NaturalId;
/**
 * 
 * @author tkhasano
 *
 */
@Entity
@Table(name = "application")
public class Application implements com.webas.api.Application
{
	private static final long serialVersionUID = -9200804524025548138L;

	private Long id;
	
    @NaturalId
    @Column(unique = true)
    private String name;
    
    private String description;

    public Application() {}

    public Application(final String name)
    {
        this.name = name;
    }
    
    public Application(final String name, final String description)
    {
        this.name = name;
        this.description = description;
    }
    
    @Id
    @GeneratedValue
    public Long getId() {
        return id;
    }

    public void setId(final Long id) {
        this.id = id;
    }

    @Size(min = 3, max = 50)
    @NotNull
    public String getName() {
        return name;
    }

    public void setName(final String name) {
        this.name = name;
    }
    
    @Size(max = 255)
    public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
}